from ...service.buss_pub.excel_manage import ExcelManageService
'''
@Description: In User Settings Edit
@Author: your name
@Date: 2019-08-22 16:01:27
@LastEditTime : 2019-12-31 10:13:42
@LastEditors  : Please set LastEditors
'''
# -*- coding: utf-8 -*-
'''
导入导出管理相关函数注册
'''


def register(jsonrpc, db_addr, db_port, db_name, db_user, db_pwd, inital_password, session, web_path, upload_file):
    excel_manage_func = ExcelManageService(
        db_addr, db_port, db_name, db_user, db_pwd, inital_password, session, web_path, upload_file)

    @jsonrpc.method('IExcelService.export_excel')
    def __export_excel(method, condition):
        '''导出'''
        res = excel_manage_func.export_excel(method, condition)
        return res

    @jsonrpc.method('IExcelService.import_excel_admin')
    def __import_excel_admin():
        '''导入'''
        res = excel_manage_func.import_excel_admin()
        return res

    @jsonrpc.method('IExcelService.import_excel_org')
    def __import_excel_org():
        '''导入'''
        res = excel_manage_func.import_excel_org()
        return res

    @jsonrpc.method('IExcelService.import_excel_user')
    def __import_excel_user():
        '''导入'''
        res = excel_manage_func.import_excel_user()
        return res

    @jsonrpc.method('IExcelService.change_user_data')
    def __change_user_data():
        ''' 建立已加入的用户及机构的账户信息 '''
        res = excel_manage_func.change_user_data()
        return res

    @jsonrpc.method('IExcelService.import_excel_activity')
    def __import_excel_activity():
        '''导入活动'''
        res = excel_manage_func.import_excel_activity()
        return res

    @jsonrpc.method('IExcelService.change_org_photo')
    def __change_org_photo():
        '''导入活动'''
        res = excel_manage_func.change_org_photo()
        return res

    @jsonrpc.method('IExcelService.import_excel_service_record')
    def __import_excel_service_record():
        '''导入服务记录'''
        res = excel_manage_func.import_excel_service_record()
        return res

    @jsonrpc.method('IExcelService.import_excel_user_nh')
    def __import_excel_user_nh(url):
        '''导入南海长者资料'''
        res = excel_manage_func.import_excel_user_nh(url)
        return res

    @jsonrpc.method('IExcelService.import_excel_servicer')
    def __import_excel_servicer():
        '''导入服务人员'''
        res = excel_manage_func.import_excel_servicer()
        return res

    @jsonrpc.method('IExcelService.change_old_age_mes')
    def __change_old_age_mes():
        '''修改高龄津贴申请数据'''
        res = excel_manage_func.change_old_age_mes()
        return res

    @jsonrpc.method('IExcelService.import_excel_xf_product')
    def __import_excel_xf_product():
        '''导入幸福小栈产品接口'''
        res = excel_manage_func.import_excel_xf_product()
        return res

    @jsonrpc.method('IExcelService.import_picture_files')
    def __import_picture_files(file_path):
        '''导入文件夹图片接口'''
        res = excel_manage_func.import_picture_files(file_path)
        return res

    @jsonrpc.method('IExcelService.get_url_upload_url')
    def __get_url_upload_url(file_path):
        '''通过Url获取图片'''
        res = excel_manage_func.get_url_upload_url(file_path)
        return res

    @jsonrpc.method('IExcelService.insert_government_subsidy_user')
    def __insert_government_subsidy_user():
        '''通过Url获取图片'''
        res = excel_manage_func.insert_government_subsidy_user()
        return res
